import com.young.shop.api.dao.CartsMapper;
import com.young.shop.pojo.entity.Carts;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import java.util.List;

/**
 * @author LY
 * @date 2021/1/11 14:35
 */
@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:spring-context.xml"
        , "classpath:spring-druid.xml"
        , "classpath:spring-mybatis.xml"})
public class ShopCartTset {
    @Autowired
     private CartsMapper cartsMapper;

    @Test
    public void testSelectCart(){
        List<Carts> carts = cartsMapper.selectUpdateCart(66l);
        for (Carts carts1:carts){
            System.out.println(carts1);
        }
    }
    @Test
    public void testDelete(){
        int carts = cartsMapper.deleteById(22);
        }
}
